package com.gxm.练习.多线程.循环abc;

import java.util.ArrayList;

/**
 * @创建人 郭训民
 * @创建时间 2019/11/15
 * @描述
 */
public class AbcJoin {
    public static void main(String[] args) throws InterruptedException {
        ArrayList<String> arr = new ArrayList<String>();
        int i = 0;
        while (i<10) {
            Thread t1 = new Thread(() -> {System.out.println("a");arr.add("a");});
            t1.start();
            t1.join();
            Thread t2 = new Thread(() -> {System.out.println("b");arr.add("b");});
            t2.start();
            t2.join();
            Thread t3 = new Thread(() -> {System.out.println("c");arr.add("c");});
            t3.start();
            t3.join();
            i++;
        }
        System.out.println(arr.toString());
    }


}
